#include<iostream>
#include<string>
#include<cmath>


using namespace std;
string s1, s2, s, ss;

int main()
{
    cin >> s1 >> s2;

    for (int i = 1; i < s1.size(); i++)
    {
        if (s1[i] % 2 == s1[i - 1] % 2) {
            s += max(s1[i], s1[i - 1]);
        }
    }
    for (int i = 1; i < s2.size(); i++) 
    {
            if (s2[i] % 2 == s2[i - 1] % 2) {
                ss += max(s2[i], s2[i - 1]);
            }
    }
        if (ss == s)
        {
            cout << s;
        }
        else
        {
            cout << s << endl << ss << endl;
        }
        return 0;

    }
